<?php

/**
 * 小说分类model
 */
namespace backend\models\novel;

use Yii;
use yii\db\ActiveRecord;
use yii\data\Pagination;
use yii\data\ArrayDataProvider;

class NovelCategory extends ActiveRecord
{
    
    /**
     * 获取所有标准
     */
    public static function getAllCategory( $params = array() )
    {
        $model = self::find();
        $model->where(['cate_status'=>1]);
        if(isset($params['cate_main'])){
            $model->andWhere(['cate_main' => $params['cate_main']]);
        }
        $data = $model->asArray()->all();
        return $data;
    }
    
}

